package cz.mff.cuni.dpp.liboptions;

import java.util.Set;

/**
 * Podtřída {@link Option Option} pro volby bez parametru (někdy se
 * označují jako switch), v našem řešení nahrazují booleovské volby.
 */
public class SwitchOption extends Option<Boolean> {

	private static final String SWITCH_VALUE_PLACEHOLDER = "";

	public SwitchOption(String primaryName, Set<String> aliases, boolean obligatory,
			String description, OptionCallback<Boolean> callback) {
		super(primaryName, aliases, obligatory, SWITCH_VALUE_PLACEHOLDER, description, callback);
	}

	protected SwitchOption(Builder builder) {
		super(builder);
	}

    /**
     * Builder pro objekty typu {@link SwitchOption}, potomek {@link
     * Option.Builder}
     */
	public static class Builder extends Option.Builder<Boolean, Builder> {

		public Builder(String primaryName, boolean obligatory) {
			super(primaryName, "", obligatory);
		}

		public Builder(String primaryName) {
			super(primaryName, "");
		}

		@Override
		public SwitchOption buildOption() {
			return new SwitchOption(this);
		}

	}

}
